<?php
 
//创建索引数组
$students = array("Tom", "Jerry", "Mickey", "Minnie");

//创建关联数组
$grades = array("Tom" => 85, "Jerry" => 90, "Mickey" => 95, "Minnie" => 80);

//输出索引数组
echo "学生名单：</br>";
foreach ($students as $student) {
    echo $student . " ";
}
echo "<br><br>";

//输出关联数组
echo "学生成绩：</br>";
foreach ($grades as $name => $grade) {
    echo $name . "的成绩是" . $grade . "分 </br>";
}
echo "<br>";

//修改关联数组
$grades["Tom"] = 90;

//输出修改后的关联数组
echo "修改后的学生成绩：<br>";
foreach ($grades as $name => $grade) {
    echo $name . "的成绩是" . $grade . "分 </br>";
}
echo "<br>";

